package com.suse.service.view.order.controller;

import com.suse.common.config.response.R;
import com.suse.service.view.order.service.PayLogService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;

/**
 * <p>
 * 支付日志 前端控制器
 * </p>
 *
 * @author 辜玉彬
 * @since 2022-08-20
 */
@Api(tags = "支付接口")
@RestController
@RequestMapping("/payLog")
public class PayLogController {

    @Resource
    private PayLogService payLogService;

    @ApiOperation(value = "获取订单支付二维码")
    @GetMapping("/native/{orderNo}")
    public R getPayNative(@PathVariable("orderNo") String orderNo) {
        return payLogService.generateNative(orderNo);
    }

    @ApiOperation(value = "获取订单状态")
    @GetMapping("/status/{orderNo}")
    public R getPayStatus(@PathVariable("orderNo") String orderNo) {
        return payLogService.getPayStatus(orderNo);
    }

}

